home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4214 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  671 b 

  1. From: RMarlowe@msn.com (Roger Marlowe)
  2. Subject: RE: An array of structures in C, C++?
  3. Date: 28 Jan 96 23:42:21 -0800
  4. References: <4e6j2l$ehm@geraldo.cc.utexas.edu>
  5. Message-ID: <00001a81+00009572@msn.com>
  6. Path: news.msn.com!msn.com
  7. Newsgroups: comp.lang.c++
  8. Organization: The Microsoft Network (msn.com)
  9.  
  10. The answer is yes.  Declare a pointer of type whatever-the-struct-name-is
  11. and then establish an array of these pointers....
  12.  
  13. structname *pointername;// pointer to a struct
  14. structname *arrayname[SIZE];//an array of structs
  15.  
  16. I believe you will have to use the 'new' operator to generate each 
  17. element of your array.
  18.  
  19. This opinion comes with the standard disclaimer....
  20.